<?php
header("Content-type:text/html; charset=utf-8");
include_once 'sys/conn/conn.php';
$pagesize=10;
$total = mysql_fetch_array(mysql_query("select count(*) from tb_zw"));//查询数据库中一共有多少条数据 
$Total = $total[0]; // 
$Totalpage = ceil($Total/$pagesize);//上舍，取整 
if(!isset($_GET['page'])||!intval($_GET['page'])||$_GET['page']>$Totalpage||$_GET['page']<1){ 
	$page=1; 
}else { 
	$page=$_GET['page'];//如果不满足以上四种情况，则page的值为$_GET['page'] 
} 
$startnum = ($page-1)*$pagesize;//开始条数 
$sql = "select * from tb_zw order by id limit $startnum,$pagesize";//查询出所需要的条数 
$rs = mysql_query($sql); 
while ($contents = mysql_fetch_array($rs)){
	$result[] = $contents;
}

?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>中科智远--加入我们</title>
<link rel="stylesheet" href="style/style.css" type="text/css" />
<link rel="stylesheet" href="style/select2css.css" type="text/css" />
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
	jQuery('.newslist table tr:first').css('background','#026dc3');
	jQuery('.newslist table tr:first td').css('color','#fff');
	jQuery('.newslist table tr:nth-child(even)').css('background','#f4f4f4');
})
</script>
</head>

<body>
	<?php include_once 'header.php';?>
    <div class="menu">
    	<ul>
        	<li class="home"><a href="index.php" target="_self">首页</a></li>
            <li class="aboutZY"><a href="aboutZY.php" target="_self">关于智远</a>
			<li class="news"><a href="news.php" target="_self">新闻中心</a></li>
            <li class="products"><a href="spjk.php" target="_self">产品中心</a></li>
			<li class="kf"><a href="services.php" target="_self">客服中心</a></li>
            <li class="joinUs joinUs_st"><a href="joinUs.php" target="_self">加入我们</a></li>
        </ul>
        <div class="language">
            <div id="uboxstyle">
                <select name="language" id="language">
                    <option value="English">English</option>
                    <option value="简体中文" selected="selected">简体中文</option>
                </select>
            </div>
            <script type="text/javascript" src="js/select2css.js"></script>
        </div>
    </div>
    <div class="normal"><img src="images/joinUs.jpg" width="938" height="106" alt="加入我们" /></div>
    <div class="shadow"><img src="images/shadow.jpg" width="946" height="22" alt="" /></div>
    <div class="middle">
    	<div class="left">
        	<div class="list_tit">加入我们</div>
            <div class="list">
            	<p><img src="images/contact.jpg" width="156" height="99" alt="联系方式" /></p>
            </div>
            <div class="list_bot"><img src="images/list_bot.png" width="182" height="24" alt="list_bot" /></div>
        </div>
        <div class="right">
        	<div class="content_addr">所在位置：加入我们</div>
            <div class="content">
            	<div class="newslist">
                	<h4>最新职位</h4>
                    <table width="100%" cellpadding="0" cellspacing="0" border="0">
                    	<tr>
                        	<td width="12%">职位名称</td>
                            <td width="12%">职位类别</td>
                            <td width="36%">职位要求</td>
                            <td width="15%">工作地点</td>
                            <td width="13%">发布时间</td>
                            <td width="12%">应聘</td>
                        </tr>
                        <?php 
                        	foreach ($result as $row){
                        ?>
                        <tr>
                        	<td><?php echo $row["zw"]?></td>
                            <td><?php echo $row["zwlb"]?></td>
                            <td><?php echo $row["zwyq"]?></td>
                            <td><?php echo $row["addr"]?></td>
                            <td><?php echo $row["date"]?></td>
                            <td><input type="button" class="sq" value="申请" onclick="javascript:window.location.href='mailto:jk8654@126.com'" /> </td>
                        </tr>
                        <?php 
                        	}
                        ?>
                        <tr>
                        	<td colspan="6">
                        		<?php
								if($total){
									$per = $page - 1;//上一页
									$next = $page + 1;//下一页
									echo "<center>共有".$Total."条记录,每页".$pagesize."条,共".$Totalpage."页 ";
									if($page != 1){
										echo "<a href='".$_SERVER['PHP_SELF']."'>首页</a>";
										echo "<a href='".$_SERVER['PHP_SELF'].'?page='.$per."'> 上一页</a>";
									}
									if($page != $Totalpage){
										echo "<a href='".$_SERVER['PHP_SELF'].'?page='.$next."'> 下一页</a>";
										echo "<a href='".$_SERVER['PHP_SELF'].'?page='.$Totalpage."'> 尾页</a></center>";
									}
								}
								?>
                        	</td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="content_bot"><img src="images/content_bot.png" width="756" height="10" alt="content_bot" /></div>
        </div>
    </div>
    <?php include_once 'footer.php';?>
</body>
</html>